function setPrice() {
    var spans = new Array();
    var prices = new Array();
    var ids = new Array();
    $("span[title='price']").each(function(index) {
        var a = $(this).attr('id').indexOf(":");
        var b = $(this).attr('id').indexOf("price");
        spans[index] = $(this).attr('id').substr(a + 1, b - a - 2);
        ids[index] = $(this).attr('id');
        prices[index] = $(this);

    });

    var constPrices = new Array();

    $("input[type='hidden'][title='constPrice']").each(function(index) {
        constPrices[index] = $(this).val();
    });


    $('.o_dropdown_field').each(function(index) {
        var a = $(this).attr('id').indexOf(":");
        var b = $(this).attr('id').indexOf("productCount");
        if (spans[index] == $(this).attr('id').substr(a + 1, b - a - 2)) {
            //2 numbers after point in price
            var g = "[id*=" + ids[index] + "]";
            $(g).text(($(this).val() * constPrices[index]).toFixed(2));
            //$("#totalPrice").text(89);
        }
        var total = 0;

        for (i = 0; i < prices.length; i++) {
            total += parseFloat(prices[i].text());
        }

        $('#totalPrice').text(total.toFixed(2));
    })


}	